<template>
    <el-menu default-active="2" :router="isRouter" class="el-menu-vertical-demo" @select="select" @open="handleOpen" @close="handleClose" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
        <el-menu-item index="/status">
            <i class="el-icon-menu"></i>
            <span slot="title">运行状态</span>
        </el-menu-item>
        <el-menu-item index="/device_list">
            <i class="el-icon-document"></i>
            <span slot="title">设备列表</span>
        </el-menu-item>
        <el-menu-item index="/room_list">
            <i class="el-icon-menu"></i>
            <span slot="title">房间列表</span>
        </el-menu-item>





        <el-menu-item index="/tree">
            <i class="el-icon-menu"></i>
            <span slot="title">树形结构</span>
        </el-menu-item>
        <el-menu-item index="/index">
            <i class="el-icon-setting"></i>
            <span slot="title">基本设置</span>
        </el-menu-item>
<!--         <el-menu-item index="/logout">
            <i class="el-icon-setting"></i>
            <span slot="title">退出登录</span>
        </el-menu-item> -->
    </el-menu>
</template>
<script>
export default {
    created() {
        // 发起网络请求，检查是否初始化过了。
        // 如果已经初始化过了，则重定向到登录界面
        // 没初始化过，就停留在本界面
    },
    data() {
        console.log(this.$router)
        return {
            isRouter: true,
            title: "sss",
        }
    },
    components: {},
    methods: {
        handleOpen(key, keyPath) {
            console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
            console.log(key, keyPath);
        },
        select(key, keyPath) {
            console.log(keyPath, key);
            console.log(this.$router)
            console.log(this.$router.title)
            // 得到组件，挂载替换。？
            // this.$router.push
        }
    },
    created() {
        let currentRoute = this.$router.currentRoute
        this.content_path = currentRoute.path
    }
}
</script>
